#jinja2: trim_blocks:True, lstrip_blocks:True
version: '3.3'

services:
  goshimmer:
    image: {{goshimmerDockerImage}}:{{goshimmerDockerTag}}
    container_name: goshimmer
    volumes:
      - "./db:/db"
      - "/etc/localtime:/etc/localtime:ro"
    ports:
      # Autopeering
      - "0.0.0.0:14626:14626/udp"
      # Gossip
      - "0.0.0.0:14666:14666/tcp"
      # HTTP API
      - "0.0.0.0:8080:8080/tcp"
    {% if remoteDebugging|default(false) %}
      # Delve Debugger
      - "127.0.0.1:40000:40000/tcp"
    {% endif %}
    {% if debugPorts|default(false) %}
      # Dashboard
      - "0.0.0.0:8081:8081/tcp"
      # DAGs Visualizer
      - "0.0.0.0:8061:8061/tcp"
      # pprof profiling
      - "0.0.0.0:6061:6061/tcp"
    {% else %}
      # Dashboard
      - "127.0.0.1:8081:8081/tcp"
      # pprof profiling
      - "127.0.0.1:6061:6061/tcp"
    {% endif %}
      # prometheus
      - "0.0.0.0:9311:9311/tcp"
    environment:
      - NODE_SEED={{ seed }}
      - DATABASE_DIRECTORY=/db/mainnetdb
      - NODE_PEERDBDIRECTORY=/db/peerdb
      - ANALYSIS_CLIENT_SERVERADDRESS={{ analysisServerHost }}:21888
      - AUTOPEERING_BINDADDRESS=0.0.0.0:14626
      - DASHBOARD_BINDADDRESS=0.0.0.0:8081
      - GOSSIP_BINDADDRESS=0.0.0.0:14666
      - WEBAPI_BINDADDRESS=0.0.0.0:8080
      - PROFILING_BINDADDRESS=0.0.0.0:6061
    command: >
      --skip-config=true
     {% if snapshotResetTime|default(false) %}
      --mana.snapshotResetTime=true
     {% endif %}
      --autoPeering.entryNodes={{ entryNodePubKey }}@{{ entryNodeHost }}:15626{% if communityEntryNode|default(None) %},{{ communityEntryNode }}{% endif %}
     {% if networkVersion|default(None) %}
      --autoPeering.networkVersion={{ networkVersion }}
     {% endif %}
      --node.disablePlugins=portcheck
      --node.enablePlugins=dashboard,remotelog,networkdelay,prometheus{% if faucet|default(false) %},faucet{% endif %},activity,snapshot,WebAPIToolsDRNGEndpoint,WebAPIToolsMessageEndpoint,"WebAPI tools Endpoint"{% if spammer|default(false) %},spammer{% endif %}
      --prometheus.bindAddress=0.0.0.0:9311
      --messageLayer.snapshot.file=/snapshot.bin
     {% if faucet|default(false) %}
      --faucet.seed={{ faucetSeed }}
      --faucet.tokensPerRequest=1000000
     {% endif %}
      --pow.numThreads=8
      --pow.timeout=60s
     {% if powDifficulty|default(None) %}
      --pow.difficulty={{ powDifficulty }}
     {% endif %}
      --logger.level={{ logLevel }}
      --logger.disableEvents=false
      --logger.remotelog.serverAddress={{ remoteLoggerHost }}:5213
      --remotemetrics.metricsLevel=0
     {% if faucet|default(false) %}
      --messageLayer.startSynced=false
     {% else %}
      --messageLayer.startSynced=true
     {% endif %}
      --messageLayer.tangleTimeWindow=10m
      --messageLayer.snapshot.genesisNode={{ bootstrapNodePubKey }}
      --drng.pollen.instanceID=1
      --drng.pollen.threshold=3
      --drng.pollen.committeeMembers=AheLpbhRs1XZsRF8t8VBwuyQh9mqPHXQvthV5rsHytDG,FZ28bSTidszUBn8TTCAT9X1nVMwFNnoYBmZ1xfafez2z,GT3UxryW4rA9RN9ojnMGmZgE2wP7psagQxgVdA4B9L1P,4pB5boPvvk2o5MbMySDhqsmC2CtUdXyotPPEpb7YQPD7,64wCsTZpmKjRVHtBKXiFojw7uw3GszumfvC4kHdWsHga
     {% if xteamDRNG|default(false) %}
      --drng.xTeam.instanceID=1339
      --drng.xTeam.threshold=4
      --drng.xTeam.committeeMembers=GUdTwLDb6t6vZ7X5XzEnjFNDEVPteU7tVQ9nzKLfPjdo,68vNzBFE9HpmWLb2x4599AUUQNuimuhwn3XahTZZYUHt,Dc9n3JxYecaX3gpxVnWb4jS3KVz1K1SgSK1KpV1dzqT1,75g6r4tqGZhrgpDYZyZxVje1Qo54ezFYkCw94ELTLhPs,CN1XLXLHT9hv7fy3qNhpgNMD6uoHFkHtaNNKyNVCKybf,7SmttyqrKMkLo5NPYaiFoHs8LE6s7oCoWCQaZhui8m16,CypSmrHpTe3WQmCw54KP91F5gTmrQEL7EmTX38YStFXx
     {% endif %}
      --messageLayer.tangleTimeWindow=10m
